# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gnome-autoar
pkgver=0.4.4
pkgrel=1
pkgdesc="GNOME archive extraction library"
options="chmod-clean" # There are read-only test files
url="https://www.gnome.org/"
arch="all"
license="LGP-2.1-only"
makedepends="
	gobject-introspection-dev
	gtk+3.0-dev
	gtk-doc
	libarchive-dev
	meson
	vala
	"
subpackages="$pkgname-dev"
source="https://download.gnome.org/sources/gnome-autoar/${pkgver%.*}/gnome-autoar-$pkgver.tar.xz"

# secfixes:
#   0.3.1-r0:
#     - CVE-2021-28650
#     - CVE-2020-36241

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgtk=true \
		-Dintrospection=enabled \
		-Dvapi=true \
		-Dtests=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
c38d3703e61d7338b97c362127bdc61f77d259eecd662f3963f28bfcb1ce7be8a948e9a57e79a8181a55dfc3635f671f2160ade947a1b5122204a2dc0025682d  gnome-autoar-0.4.4.tar.xz
"
